<?php 
	defined('_JEXEC') or die;
	$location = JRequest::getVar("location");
	$location_alias = JRequest::getVar("location_alias");
	//$location = $locations->id;
	//$location_alias = $locations->alias;
	//JRequest::setVar("location",)
	$option = JRequest::getVar("option");
	if($option == "com_bakerys")
		$catid = JRequest::getVar("catid");
?>

<ul class='menu bakery_categories<?php echo $class_sfx;?>'>
	<?php foreach ($categories as $category): ?>
		<li class="<?php echo ($catid == $category->id)?"current active":"" ?>">
			<a href="<?php echo JRoute::_("index.php?option=com_bakerys&view=bakerys&location=$location:$location_alias&catid=".$category->id.":".$category->alias) ?>"><?php echo $category->title ?></a>
		</li>
	<?php endforeach; ?>
</ul>